#!/bin/bash 


dependsneeddl_array=("Apple" "Banana" "Cherry" "Date" "Elderberry")

#dependsneeddl_array+="Orange"


test_digui()
{

for depend in "${dependsneeddl_array[@]}" ; do

   if [[ "$depend" = "Apple" && $n -eq 1 ]]; then
        echo "return"
	return
   fi

   echo "depend is '${depend}'"
   if [ "$depend" = "Cherry" ]; then
     echo "jinru digui"
     n=1
     test_digui
   else
     echo "jixu xunhuan"
   fi

done

}

test_bianli()
{
   dependsneeddl_array+=("Orange")
   for depend in "${dependsneeddl_array[@]}"; do
      echo "bianli '$depend'"
   done
   
}

#test_digui
test_bianli







